package com.zsrt.java.ch02;


import org.junit.Test;

public class StackTest {
	
	
	@Test
	public void testName() throws Exception {
		Node head = new Node();
		
		Stack stack  = new Stack(head);
		
		//1 添加3个节点  3 5 9
		Node node1 = new Node(3);
		Node node2 = new Node(5);
		Node node3 = new Node(9);
		
		stack.push(node1);
		stack.push(node2);
		stack.push(node3);
		
		while(!stack.isEmpty()){
			Node node = stack.pop();
			System.out.print(node.getData()+"-->");
		}
	}

}
